package com.yl.chainStore.mapper.sick

import com.baomidou.mybatisplus.core.mapper.BaseMapper
import com.baomidou.mybatisplus.extension.plugins.pagination.Page
import com.yl.chainStore.entity.sick.SickMedicalRecordsDetail
import com.yl.chainStore.pojo.vo.sick.SickMedicalRecordsDetailSelectVo
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Param

/**
 * 就诊记录明细
 */
@Mapper
interface SickMedicalRecordsDetailMapper:BaseMapper<SickMedicalRecordsDetail> {

	/**
	 * 分页查询
	 */
	fun getPage(
		@Param("page")page:Page<SickMedicalRecordsDetail>,
		@Param("vo")vo: SickMedicalRecordsDetailSelectVo
	):Page<SickMedicalRecordsDetail>

	/**
	 * 分页查询
	 */
	fun getList(
		@Param("vo")vo: SickMedicalRecordsDetailSelectVo
	):List<SickMedicalRecordsDetail>

	/**
	 * 查询就诊明细数量
	 */
	fun selectUserRecordsDetailCount(
		@Param("vo")vo: SickMedicalRecordsDetailSelectVo
	):Int

	/**
	 * 患者最后一次就诊记录明细  执行过的（不是预约和取消）
	 */
	fun getLastRecordsDetailOpen(@Param("customerId")customerId:Long):SickMedicalRecordsDetail?

	/**
	 * 患者诊断的第一次明细		执行过的（不是预约和取消）
	 */
	fun getFirstRecordsDetailOpenByRecord(@Param("recordId")recordId:Long):SickMedicalRecordsDetail?


}
